import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;

public class LogonAuthentication extends HttpServlet{
	
	private String userID;
	private String password;
	private String name;
	
	private ServletConfig config;
	public void init(ServletConfig config)throws ServletException{
		this.config=config;
	}
	public LogonAuthentication(String userID, String password){
		this.userID=userID;
		this.password=password;
	}
	
	public void login(HttpServletRequest request, HttpServletResponse response) throws ServletException,IOException{
		//get data entered on the form
		String userID=request.getParameter("userID");
	    String password=request.getParameter("password");
	    
		User user=new User(userID,password,name);
		
		if(userID.equals("user")&& password.equals("abc123")){
			System.out.println("<a href='registration.html'><br>Reg</a>");
		}
		/*if (user.getUserID().equals(userID) && user.getSitePW().equals(password))
			System.out.println("Welcome to APS....");
		else{
			System.out.println("Please enter correct username and password");
			System.out.println("<a href='login.html'><br>Login again</a>");
			
		}*/
	
	}

}
